package day0109;

import java.util.Arrays;

public class Test13 {
    public static void main(String[] args) {
        int[]  arr={30,20,10,2,1,0,3,67,324};
        int[]  arr2=sort(arr);
        System.out.println(Arrays.toString(arr2));
    }

    static int[] sort(int[] ary){
        //1.for(int j)
        for(int j=0; j< ary.length - 1;  j++) {
            for (int i = 0; i < ary.length - 1 - 0; i++) {
                if (ary[i] > ary[i + 1]) {
                    int t = ary[i];
                    ary[i] = ary[i + 1];
                    ary[i + 1] = t;
                }
            }
        }
        return  ary;//返回排好的结果
    }

}
